export interface IChildRoute {
  path: string
  name?: string
  component: string,
  wrappers?: string[]
}
export interface IBestAFSRoute {
  routes?: IChildRoute[] // Array<IChildRoute>
  path: string
  redirect?: string,
  exact?: boolean,
  component?: string
  name?: string // 兼容此写法
  icon?: string
  // 更多功能查看
  // https://beta-pro.ant.design/docs/advanced-menu
  // ---
  // 新页面打开
  target?: string
  // 不展示顶栏
  headerRender?: boolean
  // 不展示页脚
  footerRender?: boolean
  // 不展示菜单
  menuRender?: boolean
  // 不展示菜单顶栏
  menuHeaderRender?: boolean
  // 权限配置，需要与 plugin-access 插件配合使用
  access?: string
  // 隐藏子菜单
  hideChildrenInMenu?: boolean
  // 隐藏自己和子菜单
  hideInMenu?: boolean
  // 在面包屑中隐藏
  hideInBreadcrumb?: boolean
  // 子项往上提，仍旧展示,
  flatMenu?: boolean,
  wrappers?: string[],
  role?: number
}
const routes: IBestAFSRoute[] = [
  {
    path: '/',
    exact: true,
    redirect: '/home'
  },
  {
    path: '/home',
    icon: 'HomeOutlined',
    name: '首页', // 如果需要出现在左侧的菜单栏
    component: '@/pages/home/index'
  },
  {
    // 登录页面不需要侧边菜单栏等
    path: '/login',
    // name: '登录',
    component: '@/pages/login/index',
    // 不展示顶栏
    headerRender: false,
    // 不展示页脚
    footerRender: false,
    // 不展示菜单
    menuRender: false
  },
  {
    path: '/banner',
    name: '轮播图管理',
    icon: 'FileImageOutlined',
    routes: [
      {
        path: '/banner/list',
        name: '轮播图列表',
        wrappers: [
          '@/wrappers/auth',
        ],
        component: '@/pages/banner-manager/list'
      },
      {
        path: '/banner/add',
        // name: '添加轮播图',
        wrappers: [
          '@/wrappers/auth',
        ],
        component: '@/pages/banner-manager/add'
      }
    ]
  },
  {
    path: '/pro',
    name: '产品管理',
    icon: 'UnorderedListOutlined',
    routes: [
      {
        path: '/pro/list',
        name: '产品列表',
        wrappers: [
          '@/wrappers/role',
        ],
        component: '@/pages/pro-manager/list'
      },
      {
        path: '/pro/recommend',
        name: '推荐列表',
        wrappers: [
          '@/wrappers/role',
        ],
        component: '@/pages/pro-manager/recommend'
      },
      {
        path: '/pro/seckill',
        name: '秒杀列表',
        wrappers: [
          '@/wrappers/role',
        ],
        component: '@/pages/pro-manager/seckill'
      }
    ]
  },
  {
    path: '/account',
    name: '账户管理',
    icon: 'FileImageOutlined',
    routes: [
      {
        path: '/account/user',
        name: '用户列表',
        wrappers: [
          '@/wrappers/auth',
        ],
        component: '@/pages/account-manager/userList'
      },
      {
        path: '/account/admin',
        name: '管理员列表',
        wrappers: [
          '@/wrappers/auth',
        ],
        component: '@/pages/account-manager/adminList'
      }
    ]
  },
  {
    path: '/rich',
    icon: 'HomeOutlined',
    name: '富文本编辑器', // 如果需要出现在左侧的菜单栏
    component: '@/pages/editor/Rich'
  },
  {
    path: '/mk',
    icon: 'HomeOutlined',
    name: 'markdown编辑器', // 如果需要出现在左侧的菜单栏
    component: '@/pages/editor/MarkDown'
  },
  {
    path: '/data',
    icon: 'HomeOutlined',
    name: '数据可视化',
    routes: [
      {
        path:'/data/echarts',
        name: 'echarts',
        component: '@/pages/data/echarts'
      }
    ]
  },
]

export default routes
